home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Readers / Gui4Cli / Docs / Tutorials / Window.gc < prev   
Text File  |  1997-12-02  |  2KB  |  82 lines

  1. G4C
  2.  
  3. ; ---- One window has a button which allows you to open another window. 
  4. ;      The second window really is a separate gui in its own right.
  5. ;      It could have been handled in its own separate script, but
  6. ;      here it serves as an example of using the NEWFILE command, 
  7. ;      which allows the script for the second gui to be contained 
  8. ;      within the file you are now reading.
  9. ;      See below under NEWFILE.
  10.  
  11. WinBig 100 -1 200 150 "Window.gc"
  12. WinType 11110001
  13. usetopaz
  14.  
  15. BOX 0 0 0 0 OUT RIDGE
  16.  
  17. xonLoad
  18.  
  19. ; ----- The second button and the instructions are a
  20. ;       distraction until the second window has been
  21. ;       opened, so we hide them till needed. 
  22. setgad Window.gc 1/5 HIDE
  23. GuiLoad Work:Tutorial/Window2.gc
  24. GuiOpen Window.gc
  25.  
  26. xonClose
  27. ; ---- Just before we quit the main window, we quit
  28. ;      the second one.
  29. GuiQuit Window2.gc
  30. GuiQuit Window.gc
  31.  
  32. Text 20 25 160 12 "It's hot in here ..." 22 NOBOX
  33. xButton 20 40 160 12 'Open another Window'
  34. GuiOpen Window2.gc
  35.  
  36. ; ---- As soon as the second window has been opened,
  37. ;      the other button and the instructions need to
  38. ;      be seen, and so we show them.
  39. setgad Window.gc 1/5 SHOW
  40. Redraw Window.gc
  41.  
  42. xButton 38 120 104 12 'Now close it'
  43. gadid 1
  44. GuiClose Window2.gc
  45. setgad Window.gc 1 HIDE
  46. Redraw Window.gc
  47.  
  48. Text 10 60 100 12 'Have a good look at' 20 NOBOX
  49. gadid 2
  50. Text 10 70 100 12 'the script.  This is' 20 NOBOX
  51. gadid 3
  52. Text 10 80 100 12 'a bit more complicated' 23 NOBOX
  53. gadid 4
  54. Text 10 90 100 12 'than it looks.' 14 NOBOX
  55. gadid 5
  56.  
  57.  
  58. ; ------  THIS IS ANOTHER GUI - the new window, using NEWFILE
  59.  
  60. NEWFILE Window2.gc
  61.  
  62. WinBig 310 -1 200 50 "Window2.gc"  ; Size, position, title
  63. WinType 11110001                   ; System  gadgets, etc
  64. usetopaz
  65.  
  66. ; xonLoad 
  67. ; NOTE - we can not have an xOnLoad command here, since this is a
  68. ; multi-gui file.. *Only* the xOnLoad commands of the 1st gui
  69. ; will be executed! - All other events are allowd though..
  70.  
  71.  
  72. Text 10 20 160 12 "I'm his kid brother..." 24 NOBOX
  73.  
  74. ; ---- No 'onClose' here, because when it is closed we don't
  75. ;      want it to do anything else, like GuiQuit.
  76. ;      We keep it loaded in case we want to reopen it.
  77. ;      Quitting for the second window is handled in the 
  78. ;      'onClose' of the first window.
  79.  
  80.  
  81.  
  82.